<template>
  <div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="课程收藏列表" name="courseCollect">
        <courseCollect ref="courseCollect"/>
      </el-tab-pane>
      <el-tab-pane label="题库收藏列表" name="questionCollect">
        <questionCollect ref="questionCollect"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import courseCollect from './courseCollect'
  import questionCollect from './questionCollect'

  export default {
    components: { courseCollect, questionCollect },
    data() {
      return {
        activeName: 'courseCollect'
      }
    },
    methods: {
      handleClick(tab, event) {
        this.$refs[this.activeName].init()
      }
    }
  }
</script>
